#ifndef STS_HPP
#define STS_HPP

// structs define here
enum AtomStuff : unsigned long {
  AtomFind,
  AtomGo,
  AtomUri,
  AtomUTF8,
  AtomLast
};

enum EventType {
  OnDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
  OnLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK,
  OnImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE,
  OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA,
  OnEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE,
  OnBar = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR,
  OnSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION,
  OnAny = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel,
};

enum ParamName {
  AccessMicrophone,
  AccessWebcam,
  CaretBrowsing,
  Certificate,
  CookiePolicies,
  DarkMode,
  DiskCache,
  DefaultCharset,
  DNSPrefetch,
  Ephemeral,
  FileURLsCrossAccess,
  FontSize,
  Geolocation,
  HideBackground,
  Inspector,
  JavaScript,
  KioskMode,
  LoadImages,
  MediaManualPlay,
  PreferredLanguages,
  RunInFullscreen,
  ScrollBars,
  ShowIndicators,
  SiteQuirks,
  SmoothScrolling,
  SpellChecking,
  SpellLanguages,
  StrictTLS,
  Style,
  WebGL,
  ZoomLevel,
  ParameterLast
};

struct Arg {
  int i;
  float f;
  void const *v;
};

struct Parameter {
  Arg val;
  int prio;
};

struct Client {
  GtkWidget *win;
  WebKitWebView *view;
  WebKitSettings *settings;
  WebKitWebContext *context;
  WebKitWebInspector *inspector;
  WebKitFindController *finder;
  WebKitHitTestResult *mousepos;
  GTlsCertificate *cert, *failedcert;
  GTlsCertificateFlags tlserr;
  Window xid;
  guint64 pageid;
  int progress, fullscreen, https, insecure, errorpage;
  char const *title, *overtitle, *targeturi;
  char const *needle;
  struct Client *next;
};

struct Key {
  guint mod;
  guint keyval;
  void (*func)(Client *c, Arg const *a);
  Arg const arg;
};

struct Button {
  unsigned int target;
  unsigned int mask;
  guint button;
  void (*func)(Client *c, Arg const *a, WebKitHitTestResult *h);
  Arg const arg;
  unsigned int stopevent;
};

struct UriParameters {
  char const *uri;
  Parameter config[ParameterLast];
  regex_t re;
};

struct SiteSpecific {
  char *regex;
  char *file;
  regex_t re;
};

extern Client *clients;
extern Display *dpy;
extern Atom atoms[AtomLast]; // Atom from X11
extern Parameter *curconfig;
extern char *stylefile;
extern GdkDevice *gdkkb;
extern int spair[2];
extern char const *useragent;
extern int cookiepolicy;
extern ParamName loadtransient[];
extern ParamName loadcommitted[];
extern ParamName loadfinished[];
extern int modparams[ParameterLast];

extern char *argv0;
extern Window embed;
extern int showxid;
#endif // header file protect
